# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=gtk4-layer-shell
pkgver=1.0.3
pkgrel=0
pkgdesc="Library to create desktop components for Wayland using the Layer Shell protocol and GTK4"
url="https://github.com/wmww/gtk4-layer-shell"
arch="all"
license="MIT"
makedepends="
	meson
	gtk4.0-dev
	gobject-introspection-dev
	vala
	"
checkdepends="
	font-dejavu
	luajit
	python3
	xvfb-run
	"
subpackages="$pkgname-dev $pkgname-demo"
source="$pkgname-$pkgver.tar.gz::https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # tests fail

build() {
	abuild-meson \
		-Dtests="$(want_check && echo true || echo false)" \
		-Dexamples=true \
		. output
	meson compile -C output
}

check() {
	XDG_RUNTIME_DIR="$(mktemp -d -p "$builddir")" \
		xvfb-run -a \
		meson test --no-rebuild --print-errorlogs -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

demo() {
	pkgdesc="Demo of GTK4 Layer Shell"

	amove usr/bin/gtk4-layer-demo
}

sha512sums="
b95aa4442c04c8ed98c044e510fe8291ffe5fa217d2ddd7dabf565de57136a995490017b7acdeb94150671da531c688c9946ef6fcd74d4f9ff33d69b400759de  gtk4-layer-shell-1.0.3.tar.gz
"
